package com.cws.project.cws.graduation.group.service.impl;

import java.util.List;

import com.cws.common.utils.DateUtils;
import com.cws.common.utils.text.Convert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cws.project.cws.graduation.group.mapper.GraduationGroupMapper;
import com.cws.project.cws.graduation.group.domain.GraduationGroup;
import com.cws.project.cws.graduation.group.service.IGraduationGroupService;

/**
 * 毕设设计小组管理Service业务层处理
 *
 * @author xyl
 * @date 2022-01-19
 */
@Service
public class GraduationGroupServiceImpl implements IGraduationGroupService {
    @Autowired
    private GraduationGroupMapper graduationGroupMapper;

    /**
     * 查询毕设设计小组管理
     *
     * @param graduationGroupId 毕设设计小组管理ID
     * @return 毕设设计小组管理
     */
    @Override
    public GraduationGroup selectGraduationGroupById(Long graduationGroupId) {
        return graduationGroupMapper.selectGraduationGroupById(graduationGroupId);
    }

    /**
     * 查询毕设设计小组管理列表
     *
     * @param graduationGroup 毕设设计小组管理
     * @return 毕设设计小组管理
     */
    @Override
    public List<GraduationGroup> selectGraduationGroupList(GraduationGroup graduationGroup) {
        return graduationGroupMapper.selectGraduationGroupList(graduationGroup);
    }

    /**
     * 新增毕设设计小组管理
     *
     * @param graduationGroup 毕设设计小组管理
     * @return 结果
     */
    @Override
    public int insertGraduationGroup(GraduationGroup graduationGroup) {
        graduationGroup.setCreateTime(DateUtils.getNowDate());
        return graduationGroupMapper.insertGraduationGroup(graduationGroup);
    }

    /**
     * 修改毕设设计小组管理
     *
     * @param graduationGroup 毕设设计小组管理
     * @return 结果
     */
    @Override
    public int updateGraduationGroup(GraduationGroup graduationGroup) {
        graduationGroup.setUpdateTime(DateUtils.getNowDate());
        return graduationGroupMapper.updateGraduationGroup(graduationGroup);
    }

    /**
     * 删除毕设设计小组管理对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteGraduationGroupByIds(String ids) {
        return graduationGroupMapper.deleteGraduationGroupByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除毕设设计小组管理信息
     *
     * @param graduationGroupId 毕设设计小组管理ID
     * @return 结果
     */
    @Override
    public int deleteGraduationGroupById(Long graduationGroupId) {
        return graduationGroupMapper.deleteGraduationGroupById(graduationGroupId);
    }
}
